<script type="text/javascript">
     var dataConfig = {
				"aaSorting":[[0,"desc"]],
				"sDom": "<'row-fluid'<'span6'l><'span6'f>r>tip>",
				"oLanguage": {
							"sSearch": "搜索:",
							"sLengthMenu": "每页显示 _MENU_ 条记录",
							"sZeroRecords": "Nothing found - 没有记录",
							"sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
							"sInfoEmpty": "显示0条记录",
							"sInfoFiltered": "(从 _MAX_ 条数据中检索)",
							"oPaginate": {
										"sPrevious": " 上一页 ",
										"sNext":     " 下一页 "
									}
							}
				};
	var dataConfig1 = {
				"iDisplayLength":5,
				"aaSorting":[[0,"desc"]],
				"sDom": "t<'row-fluid'ip>",
				"oLanguage": {
							"sZeroRecords": "目前还没有任何充值记录",
							"sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
							"oPaginate": {
										"sPrevious": " 上一页 ",
										"sNext":     " 下一页 "
									}
							}
				};
$(function(){
$('#datatable').dataTable(dataConfig);
});
function openFinanceInfo()
{
	$('#finance_info').modal('show');
	$.post('<?php echo site_url('member/member_center/getAddFinanceInfo'); ?>',{},function(data){
		var dom = '<table class="table table-bordered table-striped" id="finance_info_table"><thead><tr><th>创建日期</th><th>订单号</th><th>金额</th><th>备注</th></tr></thead><tbody>';
		$.each(data,function(i,j){
			dom+='<tr><td>'+j['out_time']+'</td><td>'+j['order_number']+'</td><td>￥'+j['order_prince']+'</td><td>'+j['is_ok']+'</td></tr>';
		});
		$('#finance_info .modal-body').html(dom+'</tbody></table>');
		$('#finance_info_table').dataTable(dataConfig1);
//		$('#finance_info .modal-body .dataTables_wrapper .row-fluid').eq(0).remove();
	},'json');
}
function openPassFinance()
{
	$('#post_name').val('');
	$('#prince').val('');
	$('#pass_finance_btn').attr('disabled','true');
	$('#post_name').blur(function(){
		$('#pass_finance_btn').attr('disabled','true');
		$.post('<?php echo site_url('member/member_center/pass_name');?>',{'name':$(this).val()},function(data){
			if(data == 0){
				$('#post_name').siblings().remove();
				$('#post_name').after('<span class="help-inline">*无效的用户名</span>').parents('div[class=control-group]').addClass('error');
			}else{
				$('#pass_finance_btn').removeAttr('disabled');
			}
		});
	}).click(function(){
		$('#post_name').siblings().remove();
		$('#post_name').parents('div[class=control-group error]').removeClass('error');
	});
	$('#pass_finance').modal('show');
}
function openCasjFinance()
{
	$('#cash_finance').modal('show');
}
function formVerific(type)
{
	var ver = 0;
	if(type == 'pass_finance')
	{
		if($('#prince').val()*1 > 0)
		{
		}
		else
		{
			ver = 1;
			$('#prince').siblings().remove();
			$('#prince').after('<span class="help-inline">*输入大于0的数字</span>').parents('div[class=control-group]').addClass('error');
			$('#prince').click(function(){
				$('#prince').siblings().remove();
				$('#prince').parents('div[class=control-group error]').removeClass('error');
			});
		}
	}
	else
	{
	}
	if(ver == 0){
		return true;
	}else{
		return false;
	}
}
</script>
<div class="span10">
<div class="modal hide fade in" id="finance_info" style="top: 50%;">
   <div class="modal-header">
       <button type="button" class="close" data-dismiss="modal">×</button>
       <h3>历史充值明细</h3>
   </div>
   <style>
   .dataTables_info{float:left;}
   .dataTables_paginate{float:right};
   </style>
   <div class="modal-body">
   	<img src="/img/loading_b.gif" style="margin: 0 auto;"/>
   </div>
   <div class="modal-footer">
      <a href="#" class="btn" data-dismiss="modal">关闭</a>
   </div>
</div>
<div class="modal hide fade in" id="pass_finance" style="top: 50%;">
	<form class="form-horizontal"  onSubmit="return formVerific('pass_finance')" style="margin:0;" action="<?php echo site_url('member/order_center/doAdd');?>" method="post">
   <div class="modal-header">
       <button type="button" class="close" data-dismiss="modal">×</button>
       <h3>转账</h3>
   </div>
   <div class="modal-body">
   	<fieldset>
                <div class="control-group">
                <input type="hidden" value="1" name="shop_type">
                   <label class="control-label" for="post_name">接收账户：</label>
                   <div class="controls">
                       <input class="input-xlarge focused" id="post_name" name="post_name" type="text">
                   </div>
                </div>
                <div class="control-group">
                   <label class="control-label" for="prince">转账金额：</label>
                   <div class="controls">
                       <input class="input-xlarge focused" id="prince" name="prince" type="text">
                   </div>
                </div>
    </fieldset>
   	<div class="well" style="margin: 0;">
   		<h4>特别说明:</h4>
       <div style="height: 1px;margin: 5px 0px;overflow: hidden;background-color: #e5e5e5;border-bottom: 1px solid #ffffff;"></div>
       <h5 style="font-weight: normal;line-height: 20px;">系统所属账号内资金互转，请谨慎操作，该操作不可逆，有问题直接咨询在线客服</h5>
    </div>
   </div>
   <div class="modal-footer">
      <a href="#" class="btn" data-dismiss="modal">关闭</a>
      <button type="submit" class="btn btn-primary" id="pass_finance_btn">确认提交</button>
   </div>
   </form>
</div>
<div class="modal hide fade in" id="cash_finance" style="top: 50%;">
<form class="form-horizontal" style="margin:0;">
   <div class="modal-header">
       <button type="button" class="close" data-dismiss="modal">×</button>
       <h3>提现</h3>
   </div>
   <div class="modal-body">
        	<fieldset>
                <div class="control-group">
                   <label class="control-label" for="alipay_user">提现支付宝账号：</label>
                   <div class="controls">
                       <input class="input-xlarge focused" id="alipay_user" type="text">
                   </div>
                </div>
                <div class="control-group">
                   <label class="control-label" for="alipay_name">支付宝账户姓名：</label>
                   <div class="controls">
                       <input class="input-xlarge focused" id="alipay_name" type="text">
                   </div>
                </div>
                <div class="control-group">
                   <label class="control-label" for="alipay_name">提现金额：</label>
                   <div class="controls">
                       <input class="input-xlarge focused" id="alipay_name" type="text">
                   </div>
                </div>
         </fieldset>
         <div class="well" style="margin: 0;">
	   		<h4>特别说明:</h4>
	       <div style="height: 1px;margin: 5px 0px;overflow: hidden;background-color: #e5e5e5;border-bottom: 1px solid #ffffff;"></div>
	       <h5 style="font-weight: normal;line-height: 20px;">系统所属账号内资金互转，请谨慎操作，该操作不可逆，有问题直接咨询在线客服</h5>
	    </div>
   </div>
   <div class="modal-footer">
      <a href="#" class="btn" data-dismiss="modal">关闭</a>
      <button type="submit" class="btn btn-primary">提交申请</button>
   </div>
   </form>
</div>
          <div class="row-fluid">
            <div class="span12 box">
            <?php echo (isset($tips))?$tips:'';?>
                <div class="box-head">
                    <h3><i class="icon-white icon-book" style="margin-top: 7px;"></i> 账户余额</h3>
                </div>
                <div class="box-content">
                    <div class="content-inner">
                        <div class="content-settings">
                        <style>blockquote{margin: 0;}blockquote span{margin: 0 20px;}blockquote span font{font-size:25px;color:red;font-weight: bold;}</style>
                        	<div class="well">
                        		<blockquote>
                        			<span style="margin-left: 0">可用余额:<font>￥<?php echo $userInfo['fund']; ?></font></span><span>锁定金额:<font>￥<?php echo $userInfo['lock_fund']; ?></font></span><span>账户状态:<font><?php echo ($userInfo['locks_static'] == 0)?'有效':'无效';?></font></span>
                        			<div class="btn-group" style="float:right;margin-right: 100px;">
                                      <button class="btn btn-inverse" onclick="window.location.href='<?php echo site_url('member/member_center/addFinance');?>';">去充值</button>
                                      <button style="height: 28px;" class="btn btn-inverse dropdown-toggle" data-toggle="dropdown"><span class="caret" style="margin-right: 0;height: 4px;"></span></button>
                                      <ul class="dropdown-menu">
                                        <li><a href="javascript:void(0);" onclick="openFinanceInfo();">查看充值明显</a></li>
                                        <li class="divider"></li>
                                        <li><a href="javascript:void(0);" onclick="openPassFinance();">转账</a></li>
<!--                                        <li><a href="javascript:void(0);" onclick="openCasjFinance();">提现</a></li>-->
                                      </ul>
                                    </div>
                                    <div style="height: 1px;margin: 20px 0px 15px 0px;overflow: hidden;background-color: #e5e5e5;border-bottom: 1px solid #ffffff;"></div>
                                    <h4>特别说明:</h4>
                                    <h5 style="font-weight: normal;line-height: 30px;">
                                    <font color="red">可用余额</font>------当前账户内可以直接消费的金额数量;可用右边充值按钮执行充值操作；<br>
                                    <font color="red">锁定金额</font>------充值后，如果淘宝订单未确认收货，则充值金额会被系统锁定，确认收货后自动解锁,锁定金额解锁前不能完成支付。还会被用于交易纠纷等突发情况金额锁定；<br>
                                    <font color="red">账户状态</font>------账户问题或系统问题出现时，为了保证资金安全，账户会暂时失效;<br>
                                    </h5>
                        		</blockquote>
                        	</div>
                            <div class="tabbable"> <!-- Only required for left/right tabs -->
                              <ul class="nav nav-tabs">
                                <li class="<?php echo ($table_hover == 0)?'':'active';?>"><a href="<?php echo site_url('member/member_center/finance'); ?>">近三个月收支明细</a></li>
                                <li class="<?php echo ($table_hover == 1)?'':'active';?>"><a href="<?php echo site_url('member/member_center/finance?list=before'); ?>">三个月前收支明细</a></li>
                              </ul>
                              <div class="tab-content" style="overflow-x: hidden;">
                                   <div class="tab-pane active"><!-- Profile -->
				                        <table class="table table-bordered table-striped" id="datatable">
				                          <thead>
				                              <tr>
				                                <th width="15%">创建日期</th>
				                                <th width="10%">存入</th>
				                                <th width="10%">支出</th>
				                                <th>备注</th>
				                              </tr>
				                            </thead>
				                            <tbody>
				                            <?php foreach ($recordData as $k=>$v):;?>
				                              <tr>
				                                <td><?php echo date('Y-m-d H:i:s',$v['crea_time']);?></td>
				                                <?php echo ($v['fund_info']*1 > 0)?'<td>￥'.$v['fund_info'].'</td><td>-</td>':'<td>-</td><td>￥'.(-1*$v['fund_info']).'</td>';?>
				                                <td><?php echo $v['comment'];?></td>
				                              </tr>
				                            <?php endforeach;?>
				                            </tbody>
				                          </table>
                                   </div> <!-- profle -->
                                </div><!-- tab-content-->
                           </div> <!-- end tabbable -->
                        </div>
                    </div><!-- content-inner -->
                </div>
            </div>
          </div> <!-- end row -->
        </div><!--/span-->
      </div><!--/row-->